#ifndef __VSDL_MENUBAR_H__
#define __VSDL_MENUBAR_H__

#include <SDL/SDL.h>
#include "VSDL_point.h"
#include "VSDL_RGB.h"
#include "VSDL_text.h"
#include <iostream>

enum VSDL_MenuBarState{
	NOTREADY,
	NORMAL,
	ONSELECT,
};

class VSDL_MenuBar{
protected:
	VSDL_MenuBarState state;
	VSDL_RGB rectFillColor;
	SDL_Rect rect;
	bool boarderShow;
	void Init();
public:
	VSDL_Text title; //Default title string is "null"
public:
	VSDL_MenuBar();
	VSDL_MenuBar(const char *title, VSDL_Font *font);
	bool IsXYInRect(int x, int y);
	int SetTitle(const char *title);	
	int SetFont(VSDL_Font *font);
	int SetTitleColor(unsigned char r, unsigned char g, unsigned char b);
	int SetTitleColor(VSDL_RGB color);
	void SetRectFillColor(unsigned char r, unsigned char g, unsigned char b);
	void SetRectFillColor(VSDL_RGB color);
	void SelectedCheck(int mouseX, int mouseY);
	void GetTitleSize(int &titleWidth, int &titleHeight);
	void SetState(VSDL_MenuBarState state);
	bool Selected();
	void ShowBoarder(bool show);
	virtual int Blit(SDL_Surface *destSurf, int x, int y);
	virtual int Blit(SDL_Surface *destSurf, VSDL_Point point);
	virtual void OnSelected(void *arg)
	{
		std::cout << "Menu " << title.GetText() << " selected" << std::endl;
	}
};

#endif /*__VSDL_MENUBAR_H__*/
